<!-- Custom styles for this page -->
<link href="<?php echo Yii::$app->params['jicDomain']?>/admin/css/dataTables.bootstrap4.min.css" rel="stylesheet">

<!-- Begin Page Content -->
<div class="container-fluid">

  <!-- Page Heading -->
  <h1 class="h3 mb-2 text-gray-800">产品信息</h1>
  <p class="mb-4">DataTables is a third party plugin that is used to generate the demo table below. For more information about DataTables, please visit the <a target="_blank" href="https://datatables.net">official DataTables documentation</a>.</p>

  <!-- DataTales Example -->
  <div class="card shadow mb-4">
    <div class="card-header py-3">
      <h6 class="m-0 font-weight-bold text-primary">列表</h6>
    </div>
    <div class="card-body">
      <div class="table-responsive">
        <table class="table table-bordered" id="dataTable" width="100%" cellspacing="0">
          <thead>
            <tr>
              <th>ID</th>
              <th>标题</th>
              <th>封面</th>
              <th>内容</th>
              <th>置顶</th>
              <th>状态</th>
              <th>更新时间/添加时间</th>
              <th>操作</th>
            </tr>
          </thead>
          <tfoot>
            <tr>
              <th>ID</th>
              <th>标题</th>
              <th>封面</th>
              <th>内容</th>
              <th>置顶</th>
              <th>状态</th>
              <th>更新时间/添加时间</th>
              <th>操作</th>
            </tr>
          </tfoot>
          <tbody>
            <?php 
            if (!empty($bxList)) {
                echo "<tr>";
                foreach ($bxList as $info) {
                    echo "<td>{$info['id']}</td>";
                    echo "<td>{$info['title']}</td>";
                    echo "<td>{$info['cover']}</td>";
                    echo "<td>{$info['content']}</td>";
                    echo "<td>";
                    if ($info['is_top']) {
                        echo "是";
                    } else {
                        echo "否";
                    }
                    echo "</td>";
                    
                    if ($info['status'] == 0) {
                        echo "<td>已删除</td>";
                    } elseif ($info['status'] == 1) {
                        echo "<td>待审核</td>";
                    } elseif ($info['status'] == 2) {
                        echo "<td>正常</td>";
                    }
                    
                    echo "<td>" . date('Y-m-d H:i:s', $info['created_at']) . "</td>";
                    
                    if ($info['status'] == 0) {
                        echo "<td>";
                        echo "<a href=''>删除</a>";
                        echo "</td>";
                    } elseif ($info['status'] == 1) {
                        echo "<td>";
                        echo "<a href=''>通过</a>";
                        echo "</td>";
                    } elseif ($info['status'] == 2) {
                        echo "<td>";
                        echo "<a href=''>删除</a>";
                        echo "</td>";
                    }
                    
                }
                echo "</tr>";
            }
            ?>
          </tbody>
        </table>
      </div>
    </div>
  </div>

</div>
<!-- /.container-fluid -->


<!-- Page level plugins -->
<script src="<?php echo Yii::$app->params['jicDomain']?>/common/web/js/jquery.dataTables.min.js"></script>
<script src="<?php echo Yii::$app->params['jicDomain']?>/admin/js/dataTables.bootstrap4.min.js"></script>

<!-- Page level custom scripts -->
<script src="<?php echo Yii::$app->params['jicDomain']?>/admin/js/demo/datatables-demo.js"></script>
